﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Smile.Network.OAuth
{
    /// <summary>Interface for authentication with OAuth API.</summary>
    public interface IOAuthClient
    {
        // @Properties
        /// <summary>Gets or sets the consumer key./</summary>
        ///
        /// <value>The consumer key.</value>
        string ConsumerKey { get; set; }

        /// <summary>Gets or sets the consumer secret.</summary>
        ///
        /// <value>The consumer secret.</value>
        string ConsumerSecret { get; set; }

        /// <summary>Gets or sets the token.</summary>
        ///
        /// <value>The token.</value>
        string Token { get; set; }

        /// <summary>Gets or sets the token secret.</summary>
        ///
        /// <value>The token secret.</value>
        string TokenSecret { get; }

        /// <summary>Gets or sets the verifier.</summary>
        ///
        /// <value>The verifier.</value>
        string Verifier { get; }

        /// <summary>Gets or sets the identifier of the user.</summary>
        ///
        /// <value>The identifier of the user.</value>
        string UserId { get; set; }

        /// <summary>Gets the Date/Time when the session expires.</summary>
        ///
        /// <value>The expires time.</value>
        DateTime Expires { get; }

        /// <summary>Gets a value indicating whether this object is authenticated.</summary>
        ///
        /// <value>true if this object is authenticated, false if not.</value>
        bool IsAuthenticated { get; }

        // @Functions member
        /// <summary>Authenticate the client (Awaitable).</summary>
        ///
        /// <param name="consumerKey">         The consumer key.</param>
        /// <param name="consumerSecret">      The consumer secret.</param>
        /// <param name="authorizeCallbackUrl">URL of the authorize callback.</param>
        ///
        /// <returns>true if success, otherwise false (Asynchronous operation result).</returns>
        Task<bool> AuthenticateAsync(string consumerKey, string consumerSecret, string authorizeCallbackUrl);

        /// <summary>Authenticate the client (Awaitable).</summary>
        ///
        /// <param name="consumerKey">         The consumer key.</param>
        /// <param name="authorizeCallbackUrl">URL of the authorize callback.</param>
        ///
        /// <returns>true if success, otherwise false (Asynchronous operation result).</returns>
        Task<bool> AuthenticateAsync(string consumerKey, string authorizeCallbackUrl);
    }
}
